package com.sdhs.common.utils;

//import com.sdhsg.pierce.v1.client.UrlConstant;
//import com.sdhsg.pierce.v1.message.api.MessageClient;
//import com.sdhsg.pierce.v1.message.api.request.SendMessageRequest;
//import com.sdhsg.pierce.v1.message.api.response.SendMessageResponse;

import java.util.*;

public class SmsUtil {

    //竹云项目短信验证码
    private static String appId ="1780152885735211008";
    private static String secret ="p12ewYYwIkrHFJMIlQTEOZJvjhepB15t";
    private static String smsCreator = "20230630161245289-D638-357C01322";
    // 开发环境
//    private static String  active = UrlConstant.ACTIVE_PROD;
    boolean isUnifiedUser = true;

    /**
     * 派发短信
     * @param userName
     * @param msg
     */
    public static void SendSms(String userName,String msg){
//        MessageClient client = new MessageClient();
//        SendMessageRequest request = new SendMessageRequest();
//        request.setAppId(appId);
//        request.setType(SendMessageRequest.MessageType.SMS);
//        request.setTitle("综合业务系统短信");
//
//        SendMessageRequest.Receivers receivers = new SendMessageRequest.Receivers();
//        List<String> receiveAddr = new ArrayList<>();
//        receiveAddr.add(userName);
//        receivers.setReceiveAddr(receiveAddr);
//        request.setReceivers(receivers);
//        request.setContent(msg);
//        request.setMsgCreator(smsCreator);
//        SendMessageResponse response = null;
//        try {
//            response = client.sendMessage(secret, request, true, active);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }



    /**
     * 批量短信发送
     * @param telList
     * @param msg
     */
    public static void SendGroupSms(List<String> telList,String msg){
//        MessageClient client = new MessageClient();
//        SendMessageRequest request = new SendMessageRequest();
//        request.setAppId(appId);
//        request.setType(SendMessageRequest.MessageType.SMS);
//        request.setTitle("综合业务系统短信");
//
//        SendMessageRequest.Receivers receivers = new SendMessageRequest.Receivers();
//        receivers.setReceiveAddr(telList);
//        request.setReceivers(receivers);
//        request.setContent(msg);
//        request.setMsgCreator(smsCreator);
//        SendMessageResponse response = null;
//        try {
//            response = client.sendMessage(secret, request, true, active);
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
    }

}
